<%@page import="model.Role"%>
<%@page import="model.Staff"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<%
    Staff staff = (Staff) session.getAttribute("staff");

    if (staff == null) {
        response.sendRedirect(request.getContextPath() + "/Administration");
    } else if (!staff.getRoleList().contains(new Role(3))) {
        response.sendRedirect(request.getContextPath() + "/Administration/home");
    } else {
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Add Supplier</title>
        <link href="<%= request.getContextPath()%>/css/style_for_page.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_menu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_addtion.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_warehousing.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/adMenu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/tHeaderFooter.css" rel="stylesheet" type="text/css"/>
    </head>
     <body style="background-color: lightsteelblue;">
         <div class="headerbg">
            <div class="header"> 
                <%@include file="/include/mHeader.jsp" %>
            </div>
            <div class="adContent">
                <div class="adMenu">
                    <%@include file="/include/mMenu.jsp" %>
                </div>
            </div>
        </div>
            <div class="content" style="border-bottom:  1px black dashed; ">
                <div class="registerbg">
                    <div class="registerForm">
                        <h1>New Supplier</h1>
                        <s:form action="addsupplier" namespace="/Administration/Supplier">
                            <s:textfield name="name" label="Supplier Name" size="30" />
                            <s:textfield name="address" label="Address" size="30" />
                            <s:textfield name="description" label="Description" size="30" />
                            <s:textfield name="email" label="Email" size="30" />
                            <s:textfield name="phone" label="Phone Number" size="30" />
                            <s:textfield name="others" label="Others" size="30" />
                            <table>
                                <tr>
                                    <td>
                                        <s:reset value="Reset" cssStyle="width: 96px" theme="simple" />
                                    </td>
                                    <td>
                                        <s:submit value="Add Supplier" cssStyle="width: 96px; margin-left: 132px" theme="simple" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2"><s:actionerror /></td>
                                </tr>
                            </table>
                        </s:form>
                    </div>
                      <div class="registerTerms">
                        <h1>Add Supplier Notes</h1>
                        </br>
                        <p>- <b>All fields are required.</b></p>
                        <p>- Phone should contain <b>only 10 digits.</b></p>
                        <p>- Birth Date should be in <b>mm/dd/yyyy</b> format (e.g. 02/28/2000).</p>
                        <br>   
                    </div>
                </div> 
            </div>
        <footer>
            <div id="footer">
                <%@include file="/include/iFooter.jsp" %>
            </div>   
        </footer>

    </body>
</html>
<%
    }
%>